package vinux.web.common.controller;

import java.util.Map;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import vinux.service.common.base.BaseController;
import vinux.service.common.pension.PensionUtils;
import vinux.service.common.statics.Constant;
import vinux.service.common.util.CollectionUtils;



/**
 * 生成页面校验Token的controller
 * @author 苏超
 * 2016年10月31日
 */
@Controller
@Scope(Constant.SCOPE)
@RequestMapping("checkSubmission")
public class CheckSubmissionController extends BaseController {

	
	@RequestMapping("toCheckView")
	public ModelAndView toCheckView(){
		ModelAndView model = new ModelAndView();
		model.addObject("/common/check_submission");
		return model;
	}
	
	
	@RequestMapping("generateToken")
	@ResponseBody
	public Map<String,Object> generateToken(){
		Map<String,Object> result = CollectionUtils.newHashMap();
		String token = PensionUtils.getTokenString();
		result.put("token", token);
		return result;
	}
	
}
